SWError Class Reference
#include <SWError.h>
List of all members.
Detailed Description
The SWError class allows you to post error messages to the Server Watch error console.
The Server Watch error console displays all the errors it recieves in a listed format. The error console should be used instead of calls to MessageBox in most cases for the following reason:
1) Message boxes can stop Server Watch from continuing standard processing. Since Server Watch is often set to run regularly in the background, this will cease the tool from working as the user expects.
2) Errors will often occur during the ping process which can be run automatically at intervals. Traditional error dialogs will often be be created in mass, causing the user to close large numbers of error dialogs when they return to their computer.
3) Most traditional error message dialogs (like MessageBox) do not have an easy way to cut and paste the error message. This can be a very useful capability in debugging your user's problem.
- Use the Pre-defined Macros
- Rarely should you use this class directly. Instead, us the following macros:
SWERROR_MESSAGE
SWDEBUG_ERROR
- Singleton
- SWError is a singleton class and cannot be directly implemented. Instead, to get access to the class, furst call the SWError::GetInstance() static method. This will retrieve the singleton instance.
- Thread Safety
- SWError is a fully thread safe class. You can use it during Ping processing or in other cases where threading is involved.
Constructor & Destructor Documentation
SWError::SWError |
( |
|
) |
[protected] |
|
SWError::SWError |
( |
const SWError & |
|
) |
[protected] |
|
virtual SWError::~SWError |
( |
|
) |
[protected, virtual] |
|
Member Function Documentation
SWError* SWError::GetInstance |
( |
|
) |
[static] |
|
|
Retrieves the singleton instance of the SWError class.
You should not use this directly. Instead used on of the many macros that have been defined to handle error handling. - Returns:
- The singleton instance of the SWError class.
|
void SWError::SetError |
( |
LPCTSTR |
szCaption, |
|
|
LPCTSTR |
szErrorText |
|
) |
|
|
|
Posts a new error message to the Server Watch error console.
You should not use this directly. Instead used on of the many macros that have been defined to handle error handling. - Parameters:
-
| szCaption | The error heading text. This usually defines the topic the error fits under. |
| szErrorText | The text of the actual error. |
|
void SWError::SetParent |
( |
HWND |
hwndNewParent |
) |
|
|
|
Sets the parent window of the Server Watch error console. - Note:
- This function should not be called by plugins.
- Parameters:
-
| hwndNewParent | The new parent window of the error console. |
|
The documentation for this class was generated from the following file: